package com.anda.jsu.yangsp.core.sys.mail.bean;

import java.util.Properties;

/**
 * 邮件信息
 * 
 * @author xiaolu
 * @since 2012-12-06
 * 
 */
public class AndaMailSenderInfoBean {

	// 发送邮件服务器的IP和端口
	private String mailServersHost;// = "smtp.163.com";
	private String mailServersPort = "25";
	// 邮件发送者地址
	private String fromMailAddress;
	// 邮件接收地址
	private String toMailAddress;
	// 登录邮件发送服务器的用户名和密码
	private String userName;// = "anda_notice@163.com";
	private String securityWord;// = "anda.notice";
	// 是否需要身份验证
	private boolean validate = true;
	// 邮件主题
	private String mailSubject;
	// 邮件内容
	private String mailContent;

	/**
	 * 获得邮件会话属性
	 * 
	 * @return
	 */
	public Properties getProperties() {
		Properties prop = new Properties();
		prop.put("mail.smtp.host", this.mailServersHost);
		prop.put("mail.smtp.port", this.mailServersPort);
		prop.put("mail.smtp.auth", validate ? "true" : "false");
		return prop;
	}

	public String getMailServersHost() {
		return mailServersHost;
	}

	public void setMailServersHost(String mailServersHost) {
		this.mailServersHost = mailServersHost;
	}

	public String getMailServersPort() {
		return mailServersPort;
	}

	public void setMailServersPort(String mailServersPort) {
		this.mailServersPort = mailServersPort;
	}

	public String getFromMailAddress() {
		return fromMailAddress;
	}

	public void setFromMailAddress(String fromMailAddress) {
		this.fromMailAddress = fromMailAddress;
	}

	public String getToMailAddress() {
		return toMailAddress;
	}

	public void setToMailAddress(String toMailAddress) {
		this.toMailAddress = toMailAddress;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSecurityWord() {
		return securityWord;
	}

	public void setSecurityWord(String securityWord) {
		this.securityWord = securityWord;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(boolean validate) {
		this.validate = validate;
	}

	public String getMailSubject() {
		return mailSubject;
	}

	public void setMailSubject(String mailSubject) {
		this.mailSubject = mailSubject;
	}

	public String getMailContent() {
		return mailContent;
	}

	public void setMailContent(String mailContent) {
		this.mailContent = mailContent;
	}

}
